package com.eazy.lkv2.web.controller.system;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import com.eazy.lkv2.core.web.utils.StrKit;
import com.eazy.lkv2.web.controller.BaseController;
import com.eazy.lkv2.web.service.system.SystemMenuService;
import com.eazy.lkv2.web.service.system.SystemPermissionService;


/**
 * @author jzx
 * @date 2016.3.24
 * @desc 功能权限
 */
@Controller
@RequestMapping("/function")
public class SystemPermissionController extends BaseController {
	
	@Autowired
	private SystemPermissionService systemPermissionService;
	@Autowired
	private SystemMenuService systemMenuService;
	
	/**
	 * 获取功能列表
	 */
	@RequestMapping(value = "list" , method = {RequestMethod.GET })
	public ModelAndView permissionList(@RequestParam(defaultValue="") String id ,@RequestParam(defaultValue="") String pid)  {
		List<Map<String,Object>> data = null;
		if(StrKit.notEmpty(id)) {
			data = systemMenuService.selectSubMenu(id);
		}
		addObject("id", id);
		addObject("pid", pid);
		return getSuccess("admin/permission_list", "data", data);
	}
	
	
}
